import { BrowserRouter, Navigate, Route, Routes } from "react-router-dom";
import Layout from "./pages/Layout";
import Params from "./pages/params";
import ParamDetail from "./pages/params/detail";
import Querys from "./pages/query";
import QueryDetail from "./pages/query/detail";
import List from "./pages/list";
import ListDetail from "./pages/list/detail";

const App = () => {
    return (
        <BrowserRouter>
            <Routes>
                <Route path='/' element={<Layout />}>
                    <Route index element={<Navigate to='/params' replace />} />
                    <Route path='/params' element={<Params />}>
                        <Route path='detail/:id' element={<ParamDetail />} />
                    </Route>
                    <Route path='/querys' element={<Querys />}>
                        <Route path='detail' element={<QueryDetail />} />
                    </Route>
                    <Route path='/list' element={<List />}>
                        <Route path='detail/:id' element={<ListDetail />} />
                    </Route>
                </Route>
            </Routes>
        </BrowserRouter>
    );
};

export default App;
